package com.fanghaoran.service;

import com.fanghaoran.bean.Interaction;
import com.fanghaoran.dao.WordDao;
import com.fanghaoran.entity.Words;


/**
 * @Author: win11
 * @Date: 2023/03/22/13:12
 * @Description: 单词相关操作的业务逻辑处理
 */
public class WordService {
    /**
     * 数据库对象
     */
    private final WordDao wordDao=new WordDao();

    /**
     * 获取单词数据
     */
    public Interaction getData() throws Exception {
        return wordDao.getData();
    }

    /**
     * 更新生词本
     */
    public void updateNotedBook(Words word, int userId) throws Exception {
        wordDao.updateNotedBook(word,userId);
    }
    /**
     * 获取生词本数据
     */
    public Interaction getDataOfNoteBook(int userId) throws Exception {
        return wordDao.getDataOfNoteBook(userId);
    }
}
